#define _CRT_SECURE_NO_WARNINGS 1
void Swap(int* p, int* q)
{
    int temp = 0;
    temp = *p;
    *p = *q;
    *q = temp;
}
int removeElement(int* nums, int numsSize, int val)
{
    int count = 0;
    for (int i = 0; i < numsSize; i++)
    {
        int count = 0;
        if (nums[i] == val)
        {
            nums[i] = 0;
            count++;
        }
    }

    for (int i = 0; i < numsSize; i++)
    {
        for (int j = 0; j < numsSize - i; j++)
        {
            if (nums[j] < nums[j + 1])
            {
                Swap(nums + j, nums + j + 1);
            }
        }
    }
    return val - count;
}


int main()
{
    int nums[8] = { 0, 1, 2, 2, 3, 0, 4, 2 };
    removeElement(nums, 8, 2);
    return 0;
}